﻿@{
    Layout = null;
}

                      
@model ElingOA6_Admin_DSJCJ.Model.CdLeaveReason

<!DOCTYPE html>
<html>
<head>
    @if (false)
    {
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/FloatDiv.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/regex.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/PageCommon.js", true)" type="text/javascript"></script>

    @Html.DevExpress().GetStyleSheets(
        new StyleSheet { ExtensionType = ExtensionType.ListBox }
    )
    @Html.DevExpress().GetScripts(
         new Script { ExtensionType = ExtensionType.ListBox }
    )
        @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme },
        new StyleSheet { ExtensionType = ExtensionType.GridView, Theme = DevExpressHelper.Theme }
)


<script>

    $(document).ready(function () {
        var hdjsAlert = $("#hdjsAlert").val();
        if (hdjsAlert == "OK") {
            alert("操作成功");
            parent.window.location.href = rootPath + "/Admin/LeaveReason";
        }
        else if (hdjsAlert == "error") {
            alert("操作失败");
        }
    });

    function OK() {
        var FLeaveReasonCdtxt = FLeaveReasonCd.GetText();
        if (FLeaveReasonCdtxt == "") {
            alert("编号不可为空");
            return;
        }

        var FLeaveReasonNametxt = FLeaveReasonName.GetText();
        if (FLeaveReasonNametxt == "") {
            alert("名称不可为空");
            return;
        }

        form1.submit();
    }


</script>
</head>

<body>
    @using (Html.BeginForm("Save", "LeaveReason", FormMethod.Post, new { id = "form1", @class = "tableFrom" }))
    {
    <table class="tableForm">
             <tr>
                <th>
                    请假外出事由编码:</th>
                <td class="tdClass">
                @Html.DevExpress().TextBox(settings =>
                {
                    settings.Name = "FLeaveReasonCd";
                    settings.Text = Model.FLeaveReasonCd;
                    settings.ReadOnly =(bool) ViewData["isshow"];
                    settings.Width = 500;

                }).GetHtml()
                </td>
            </tr>

            <tr>
                <th>
                    请假外出事由名称:</th>
                <td class="tdClass">
              @Html.DevExpress().TextBox(settings =>
                {
                    settings.Name = "FLeaveReasonName";
                    settings.Text = Model.FLeaveReasonName;
                    settings.Width = 500;

                }).GetHtml()
                </td>
            </tr>
            <tr>
                <th>
                    类别:</th> 
                <td class="tdClass">
                      @Html.DevExpress().ComboBox(
            settings =>
            {
                settings.Name = "FClass";
                settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                settings.Properties.TextField = "Text";
                settings.Properties.ValueField = "Value";
                //settings.Properties.ClientSideEvents.SelectedIndexChanged = "function(s,e){alert(s.GetValue());}";
            }).BindList(new List<SelectListItem> {
                new SelectListItem { Text = "请假", Value = "1" }, 
                new SelectListItem { Text = "外出", Value = "2" } }).Bind(Model.FClass).GetHtml()
                    </td>

</tr>
            <tr>
            <th></th>
                <td  class="tdClass">
                                   @Html.DevExpress().CheckBox(settings =>
          {
              settings.Name = "FIsSignOut";
              settings.Text = "需要签退";
              if (Model.FIsSignOut == "Y")
              {
                  settings.Checked = true;
              }
              else
              {
                  settings.Checked = false;
              }
              settings.Width = System.Web.UI.WebControls.Unit.Percentage(96);
          }).GetHtml()
                               </td>
            </tr>
            <tr>
                <th>
                    </th>
                <td class="tdClass">
                                   @Html.DevExpress().CheckBox(settings =>
          {
              settings.Name = "FIsStat";
              settings.Text = "需要统计";
              if (Model.FIsStat == "Y")
              {
                  settings.Checked = true;
              }
              else
              {
                  settings.Checked = false;
              }
              settings.Width = System.Web.UI.WebControls.Unit.Percentage(96);
          }).GetHtml()
                </td>
              </tr>
            
    </table>
        
        @Html.Hidden("hdMethod", ViewData["hdMethod"]);
        @Html.Hidden("hdjsAlert", (ViewData["jsAlert"]));                                             
    }

</body>
</html>
